﻿using QYmall.Core.Common.Emum;
using QYmall.Core.Common.Helper;
using QYmall.Core.Model.Models;
using QYmall.Core.Model.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace QYmall.Core.IServices
{
    /// <summary>
    /// 商户信息接口
    /// </summary>
    public interface IMerchantService : IBaseService
    {
        /// <summary>
        /// 获取商户信息
        /// </summary>
        Task<Merchants?> QueryAsync(Expression<Func<Merchants, bool>> funcWhere, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 根据条件获取列表
        /// </summary>
        Task<IEnumerable<Merchants>> QueryListAsync(int top, Expression<Func<Merchants, bool>> funcWhere,
            string orderBy, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 根据条件获取分页列表
        /// </summary>
        Task<PaginationList<Merchants>> QueryPageAsync(int pageSize, int pageIndex, Expression<Func<Merchants, bool>> funcWhere,
            string orderBy, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 根据条件获取分页列表(含商品)
        /// </summary>
        Task<PaginationList<MerchantsGoodsClientDto>> QueryGoodsPageAsync(int top, int pageSize, int pageIndex, Expression<Func<Merchants, bool>> funcWhere,
            string orderBy, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 获取商户总数量
        /// </summary>
        Task<int> QueryCountAsync(Expression<Func<Merchants, bool>> funcWhere, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 添加记录
        /// </summary>
        Task<MerchantsDto> AddAsync(MerchantsEditDto modelDto, WriteRoRead writeAndRead = WriteRoRead.Write);

        /// <summary>
        /// 修改记录
        /// </summary>
        Task<bool> UpdateAsync(int id, MerchantsBaseDto modelDto, WriteRoRead writeAndRead = WriteRoRead.Write);
    }
}
